package com.mrtaohuan.action;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.google.appengine.labs.repackaged.org.json.JSONObject;
import com.google.inject.Inject;
import com.mrtaohuan.data.dao.UserDAO;
import com.mrtaohuan.data.entity.User;

@Path("/hello")
public class Hello {

	@Inject
	private UserDAO userDAO;

	@GET
	@Produces({ MediaType.APPLICATION_JSON })
	public String say() {

		User user = new User("mail.taohuan@gmail.com", "123456", "taohuan",
				"http://www.mrtaohuan.com");
		userDAO.save(user);
		return new JSONObject(user).toString();
	}

}
